var userMoney=0
$(function() {

	$.ajax({
		url: "http://114.55.145.243:8080/liantu/Login/UsersServlet/loginUserById",
		//url:"http://localhost:8080/javaproject/Login",
		async: false,
		xhrFields: {
			withCredentials: true
		},
		success: function(data) {
			if(data.data) {
				$("#logining").css("width", "130px");
				$("#logining").prop("href", "member_info.html")
				$("#logining").html(data.data.user_tel);
				if(data.data.user_dis==3){
					$("#sqdy").html("")
				}
				userMoney=data.data.user_money
				var lmsg = new Vue({
					el: "#Luser",
					data: {
						info: data.data
					},
					methods: {
						getTel(item) {
							return item
						},
						getUid(item) {

							return item
						},
						getImgUrl(item) {
							var url = 'http://114.55.145.243:8080/img/img/' + item + '.jpg'
							return url
						},
						getUserClass(item) {
							if(item == "女")
								return 'gender famale';
							if(item == "男")
								return 'gender male';
						}
					}
				})

			} else
				alert(data.msg)
		},
		dataType: "json"
	})
})

//接收一个值
function oneValues() {
	var result;
	var url = window.location.search; //获取url中"?"符后的字串  
	if(url.indexOf("?") != -1) {
		result = url.substr(url.indexOf("=") + 1);
	}
	return result;

}

function onCityIndex(item) {
	for(var i = 0; i < provinceList.length; i++) {
		for(var j = 0; j < provinceList[i].cityList.length; j++) {
			if(provinceList[i].cityList[j].name == item+"市") {
				
				return i;
			}
			if(provinceList[i].name == item) {
				
				return i
			}

		}
	}
}

function GetRequest() {
        //首先获取到当前页面的地址栏信息
        var url = window.location.href;//获取url地址
        var obj = {};//待会用来存放参数的对象
        var reg = /\?/;//匹配从?截取
        if(url.match(reg)) {
            //判断传入参数，以问号截取，问号后是参数
            var chars = url.split('?')[1];
            var arr = chars.split('&');//截取&号
            //获得截取后的数组为键值对字符串
            for (var i = 0; i < arr.length; i++) {
                //保守一点确定看是否为 name=value形式
                var num = arr[i].indexOf("=");
                if (num > 0) {
                    //拼接字符串
                    var name = arr[i].substring(0, num);
                    var value = arr[i].substr(num + 1);
                    //拼接对象，并转码
                    obj[decodeURIComponent(name)] = decodeURIComponent(value);
                }
            }
        }
        return obj;
    }